home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11423 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: news.iadfw.net!usenet
  2. From: Larry Weiss <lfw@iadfw.net>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Borland C's tmpnam()
  5. Date: Sat, 23 Mar 1996 21:26:23 -0600
  6. Organization: customer of Internet America
  7. Message-ID: <3154C0DF.6E90@iadfw.net>
  8. References: <AD75E5DC9668E2A52@mcdiala13.it.luc.edu> <Pine.A32.3.91.960322134158.23347A-100000@red.weeg.uiowa.edu> <AD78E5E796681EC58@mcdialb10.it.luc.edu> <827626790snz@genesis.demon.co.uk>
  9. NNTP-Posting-Host: dal12-25.ppp.iadfw.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (Win16; I)
  14.  
  15. Lawrence Kirby wrote:
  16.  > 
  17.  > In article <AD78E5E796681EC58@mcdialb10.it.luc.edu>
  18.  >            VArase@varase.it.luc.edu "Verne Arase" writes:
  19.  > 
  20.  > >In article <Pine.A32.3.91.960322134158.23347A-100000@red.weeg.uiowa.edu>,
  21.  > >The Amorphous Mass <robinson@blue.weeg.uiowa.edu> wrote:
  22.  > >
  23.  > > >> The online documentation (all I have) says that it returns a file name
  24.  > > >> "which can be safely used as the name of a temporary file".
  25.  > > >> What does this mean?
  26.  > > >  It means that it generates a filename that is guaranteed to be unique
  27.  > > >-- ie it won't overwrite an existing file. 
  28.  > >
  29.  > 
  30.  > >The other response I mentioned said that (_my synopsis_) all it guaranteed
  31.  > >was that the provided file name is compatible with your file system.
  32.  > 
  33.  > That is wrong. The standard says (7.9.9.4)
  34.  > 
  35. > "The tempnam function generates a string that is a valid file name and that
  36. >  is not the name of an existing file."
  37.  
  38. I might have written the Standard to say "not the name of an existing file at
  39. the time that the name was created".   There is no guarantee that that particular
  40. name is somehow reserved against future use by other processes that may be competing
  41. with your C based process for file names.   Or am I wrong?   (in other words if
  42. your process doesn't hurry to open a file with that name, then all bets are off
  43. about that name already being used to represent an existing file).
  44.